package org.jspar.temp;

import java.util.ArrayList;
import java.util.List;

import javax.swing.ListModel;
import javax.swing.event.ListDataListener;

public class ExpansionListModel implements ListModel {

	private List<ListDataListener> listeners = new ArrayList<ListDataListener>();
	private GlobalRouting routing;

	public ExpansionListModel(GlobalRouting routing) {
		this.routing = routing;
	}

	@Override
	public void addListDataListener(ListDataListener l) {
		listeners.add(l);
	}
	
	@Override
	public void removeListDataListener(ListDataListener l) {
		listeners.remove(l);
	}

	@Override
	public Object getElementAt(int index) {
		return routing.getActiveExpansions().get(index);
	}

	@Override
	public int getSize() {
		return routing.getActiveExpansions().size();
	}

}
